
------------
--print()%
-- was looking for how to print this buffer's file name, 
--print(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
ThisFile = function()
--print(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
  return (vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()))
end
--


-- turning off this attempt to make coloured text for now
--there has to be a better way to just simply add a splash of colour to the startup than having to manually configure all this  verbose  gubbins...
---- Function to color text using ANSI escape codes
--local function color_text(text, color_code)
--  return "\27[" .. color_code .. "m" .. text .. "\27[0m"
--end

--
-- -----------------------------------
-- ----- Digintro/Digoutro -----------

-- day of month for Digintro/Digoutro
Dayt = tonumber(os.date("%d"))

-- Define the Day variable
Day = 7

-- Define the functions to return strings
Digintro = function()
  return "Loading init.lua.  "
-- hafta  disable that.  it's not this this file.  it's whatever i'm opening.
--return "Loading: " .. ThisFile() .. " for great good.  "
end

DigDay = function()
  return "Advent of Neovim, Day " .. Day .. " (" .. Dayt .. ")" .. ".  "
end

DigitsSitrep = function()
  return "Mended with upgrades."  
-- trying to make it coloured (with the local function up top)
-- --  return "\27[" .. "31" .. "m" .. "Mended with upgrades." .. "\27[0m"
--return "\27[" .. color_code .. "m" .. "Mended with upgrades" .. "\27[0m"
--  return color_text("Mended with upgrades.  ", "32")  -- Green color
end

Digoutro = function()
return "Loaded init.lua.  "
-- hafta  disable that.  it's not this this file.  it's whatever i'm opening.
--  return "Loaded: " .. ThisFile() .. " and that was grand.  "
end

-- -----------------------------------
-- ----- Digintro/Digoutro -----------

-- -----------------------------------
-- ----- Digintro --------------------
-- Concatenate and print the result
print(Digintro() .. DigDay() .. DigitsSitrep())
-- ----- Digintro --------------------
-- -----------------------------------

----testing this to see if executing this line gets treesitter to magically work:
--Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
-- nope not even syntax hilighting liked that.   struggling on day 6.

--ExampleFunction = function() print "example function" end
-- and a comment. 

-- plugin manager stuff
require("config.lazy")

-- tabs and autoindentation stuff
vim.opt.shiftwidth = 4
-- paste (p) pastes from clipboard buffer
vim.opt.clipboard = "unnamedplus"

--binds
--carriage return "<CR>", yup.
-- -- reload code
-- -- -- reload current file
vim.keymap.set("n", "<space><space>r", "<cmd>source %<CR>")
-- reload line 
vim.keymap.set("n", "<space>r", ":.lua<CR>")
-- reload visual mode selection
vim.keymap.set("v", "<space>r", ":lua<CR>")


-- ------------------------------
-- ----- reminders --------------
-- i insert
-- x del cursor
-- r replace cursor
-- d delete
-- dd delete line
-- $ end of line
-- 0 start of line
-- w word
-- e end of word?
-- u undo
-- U undo line changes
-- p paste
-- gg go to start line of file?
-- G go to last line of file.
-- : command
-- :source % source this file
-- % this file
-- ... i presume d% deletes file contents.  :3
-- h left
-- j down
-- k up
-- l right
-- :q quit
-- :w save (write)
-- :wq! write and save i mean it!
-- :q! quit!  i mean it!
-- y  ... 
-- yap ...
-- :help <cmd>  ... oh that's good!  anything you dont know...
-- hift k on links follows themi- :help ...
-- :help help   ... shows how to get help on other things...
-- :ls lists buffers n stuff
-- :buffer n  switch to buffer of n number
-- :b 1 switch to first buffer
-- ctrl-w T new tab
-- ctrl-w c close tab  ... something like that anyways.
-- ctrl-w other stuff too...

-- there are 2 ways to do a function:
-- -- function functionName()
-- -- print("i am functionName")
-- -- end
-- or 
-- -- funName = function()
-- --   print("this is funName")
-- -- end

-- ----- things i still need to know
-- fullscreen
-- save as
-- how to make cursor keys wrap lines
-- switch buffer back n forth easily

-- -------- reminders --------------------
-- ---------------------------------------


-- [re] add the thing from end of teej's 3rd dvent of neovim
--
vim.api.nvim_create_autocmd('TextYankPost', {
    desc = 'Highlight when yanking (copying) text',
    group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
    callback = function()
        vim.highlight.on_yank()
    end,
})

  
-- imports n things
-- i may wanna do a more sane dir structure than ~/.config/nvim/lua/config...

-- will tweak this to work with the function.
--print("loaded: advent of neovim; day 6 (catching up)")
--


-- -----------------------------------
-- ----- Digoutro --------------------
print(Digoutro() .. DigDay() .. DigitsSitrep())
--print(Digoutro() .. Day() .. DigitsSitrep())
--print(Digoutro() .. DigDay() .. DigitsSitrep())
-- ----- Digoutro --------------------
-- -----------------------------------







